﻿using System;
using System.Collections.Generic;
using System.Text;

namespace hedefgrup.reports.common.SSRD
{
    public class Report_SSRD_BackOffice : Report_SSRD_Verbatim
    {
        protected override string GetSelectFields()
        {
            return
                "SELECT IID, YIL, AY, " +
                "[SATIŞ TARİHİ] = CONVERT(VARCHAR, YIL) + SUBSTRING('0' + CONVERT(VARCHAR, AY), LEN('0' + CONVERT(VARCHAR, AY) - 2), 2), " +
                base.DealerColumn + ", " +
                "[YETKİLİ SERVİS] = SERVIS, MARKA, MODELGRUP, MODEL, SASENO, [BO ADI] = BO_AD, [BO AKSİYON] = BO_AKSIYON, [BO ARAMA TARİHİ] = BO_ATARIH, [BO BAYİİ] = BO_BAYI, BO_FAALIYET, [BO KAPAMA TARİHİ] = BO_KTARIH, [BO MARKA] = BO_MARKA, [BO MEMNUNİYET] = BO_MEMNUNIYET, [BO VAKA NUMARASI] = BO_VAKA, S8 ";
        }

        public override string GetSqlStatementFilter()
        {
            string sqlStatementFilter = base.GetSqlStatementFilter();
            if (!string.IsNullOrEmpty(sqlStatementFilter))
            {
                sqlStatementFilter += " AND ";
            }
            return sqlStatementFilter + "BO_AD IS NOT NULL ";
        }

        protected override List<string> GetVerbatimQuestions()
        {
            return new List<string>(new string[] { "BO_FAALIYET" });
        }

        protected override List<string> GetVerbatimOnlyQuestions()
        {
            return new List<string>(new string[] { "BO_FAALIYET" });
        }

        public override string DisplayName
        {
            get
            {
                return "Back Office Dosya";
            }
        }

        public override string SortPrefix
        {
            get { return "SSRD_07"; }
        }

        public override bool SupportsProject(string projectName)
        {
            return Context.CompatibleProjectName == Global.PROJECT_SSRD;
        }
    }
}
